package com.example.as_sum.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.FragmentActivity;

import com.example.as_sum.R;
import com.example.as_sum.util.StatusBarCompat;

/**
 * Created by ran on 2016/7/18.
 */
public class WelcomeActivity extends FragmentActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //延迟加载布局
//        try {
//            Thread.sleep(3000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        setContentView(R.layout.activity_welcome);
        StatusBarCompat.translucentStatusBar(this);
        mHandler.sendEmptyMessageDelayed(0,3000);
    }
    Handler mHandler=new Handler(new Handler.Callback() {
        @Override
        public boolean handleMessage(Message msg) {
            switch (msg.what){
                case 0:
                    Intent intent=new Intent(WelcomeActivity.this,MainActivity.class);
                    startActivity(intent);
                    finish();
                    break;
            }
            return false;
        }
    });
}
